package com.primal.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.servlet.ModelAndView;
import org.springframework.web.servlet.config.annotation.DelegatingWebMvcConfiguration;

import java.util.HashMap;
import java.util.Map;

/**
 * @author:whh
 * @date: 2024-01-30 21:23
 * <p></p>
 */
@Controller
public class MvcController {
@Autowired
DelegatingWebMvcConfiguration delegatingWebMvcConfiguration;

    @RequestMapping(path = "/hello",method = RequestMethod.GET)
    public ModelAndView fun1(){

        ModelAndView modelAndView = new ModelAndView("index");
        // 添加 title 属性到 Model
        modelAndView.addObject("title", "Freemarker");
        return modelAndView;
    }
}
